package main

import (
	"fmt"
	"regexp"
)

func main() {
	// Character class `\w` represents any character from the class [A-Za-z0-9_]
	r, _ := regexp.Compile(`H\wllo`)
	fmt.Printf("%v\n", r.MatchString("Hello Regular Expression."))

	// \d represents any numeric digit
	r, _ = regexp.Compile(`\d`)
	fmt.Printf("%v\n", r.MatchString("Seven times seven is 49."))
	fmt.Printf("%v\n", r.MatchString("Seven times seven is forty-nine."))

	// \s represents any of the following whitespaces: TAB, SPACE, CR, LF,
	r, _ = regexp.Compile(`\s`)
	fmt.Printf("\n%v\n", r.MatchString("/home/bill/My Documents"))

	// \D \S \W  are negation
	// \D is any character that is not a \d
}
